package mr.ali.video.web.security;

import lombok.extern.slf4j.Slf4j;
import mr.ali.video.web.service.IUserService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Administrator
 */
@Component
@Slf4j
public class UserScurityImpl implements UserDetailsService {
   @Resource
   private IUserService userService;


   @Override
   public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
      return userService.getUserDetails(username);
   }
}

